`usefindandmodify` Is An Invalid Option

[Solved] `usefindandmodify` Is An Invalid Option | Vb - Code Explorer | yomemimo.com
Question : `useFindAndModify` is an invalid option.

Answered by : puzzled-puma-z6pu6nka5mdh

mongoose.set('useFindAndModify', false);
await mongoose.connect('mongodb://localhost:27017/test', { useNewUrlParser: true, // <-- no longer necessary useUnifiedTopology: true // <-- no longer necessary
});

Source : https://nullorempty.org/questions/69030963/Error-useFindAndModify-is-an-invalid-option | Last Update : Tue, 22 Mar 22

Question : `useFindAndModify` is an invalid option.

Answered by : sazzad-hossain-nirjhor-h1whv1vt0dd3

//***** It's a deprecated now. // No longer necessary: *******
mongoose.set('useFindAndModify', false); //No longer necessary
await mongoose.connect('mongodb://localhost:27017/test', { useNewUrlParser: true, // <-- no longer necessary useUnifiedTopology: true // <-- no longer necessary
});
// ******************** use this line of code ************
mongoose.connect(CONNECTION_URL).then(()=>{console.log('...')})
//read more: https://mongoosejs.com/docs/migrating_to_6.html#mongoose-connect-returns-a-promise

Source : https://stackoverflow.com/questions/69030963/error-usefindandmodify-is-an-invalid-option | Last Update : Thu, 13 Jan 22

Answers related to `usefindandmodify` is an invalid option

Code Explorer Popular Question For Vb